import { Controller } from "../../mvc/core/Controller";
import { DataEvent } from "../events/DataEvent";
import { TransportInfo } from "../model/TransportInfo";
import { IMoveAwardModule } from "../../../modules/interfaces/IMoveAwardModule";
import { EventName } from "../mvc/EventName";
import { CycleInfo } from "../model/CycleInfo";
import { Dispatcher } from "../../mvc/core/Dispatcher";
import { IView } from "../../mvc/interfaces/IView";
import { MoveAwardModule } from "../../../modules/MoveAwardModule";
//class MoveAwardController
    
    export  class MoveAwardController extends Controller
    {
       

        /* internal  */onTransportMoveAwardReq(arg1: DataEvent): void
        {
            var loc1=arg1.data as TransportInfo;
            if (view && view.isHide) 
            {
                view.show();
            }
            (view as IMoveAwardModule).updateData(EventName.TransportMoveAward, loc1);
            return;
        }

        /* internal  */onCycleTaskMoveAwardReq(arg1: DataEvent): void
        {
            var loc1=arg1.data as CycleInfo;
            if (view.isHide) 
            {
                view.show();
            }
            (view as IMoveAwardModule).updateData(EventName.CycleTaskMoveAward, loc1);
            return;
        }

        protected /* override */ initServer(): void
        {
            super.initServer();
            Dispatcher.addEventListener(EventName.TransportMoveAward, this.onTransportMoveAwardReq);
            Dispatcher.addEventListener(EventName.CycleTaskMoveAward, this.onCycleTaskMoveAwardReq);
            return;
        }

        protected /* override */ initView(): IView
        {
            var loc1=new MoveAwardModule();
            return loc1;
        }
    }
